<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
    x:Class="OpenLS.Drawing.UI.FontFamilyResources"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:UI="clr-namespace:OpenLS.Drawing.UI"
    xmlns:UI1="clr-namespace:OpenLS.UI;assembly=OpenLS.UI"
    xmlns:Internals="clr-namespace:OpenLS.Drawing.UI.Internals">
    <ResourceDictionary.MergedDictionaries>
        <UI1:ComboBoxResources></UI1:ComboBoxResources>
    </ResourceDictionary.MergedDictionaries>
    <DataTemplate DataType="{x:Type UI:FontFamilyGroup}">
        <Border BorderThickness="0 0 0 1" BorderBrush="#FFC5C5C5">
            <TextBlock Text="{Binding Name}" Background="#FFDDE7EE" FontWeight="Bold"/>
        </Border>
    </DataTemplate>
    <Style TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource {x:Static UI1:Styles.RibbonComboBoxItemStyleKey}}">
        <Style.Triggers>
            <DataTrigger Value="True">
                <DataTrigger.Binding>
                    <Binding ConverterParameter="{x:Type UI:FontFamilyGroup}">
                        <Binding.Converter>
                            <Internals:IsOfTypeConverter/>
                        </Binding.Converter>
                    </Binding>
                </DataTrigger.Binding>
                <Setter Property="IsEnabled" Value="False"></Setter>
                <Setter Property="Padding" Value="0"></Setter>
                <Setter Property="Margin" Value="0"></Setter>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style TargetType="{x:Type ComboBoxItem}" x:Key="cbis" BasedOn="{StaticResource {x:Static UI1:Styles.RibbonComboBoxItemStyleKey}}">
        <Style.Triggers>
            <DataTrigger Value="True">
                <DataTrigger.Binding>
                    <Binding ConverterParameter="{x:Type UI:FontFamilyGroup}">
                        <Binding.Converter>
                            <Internals:IsOfTypeConverter/>
                        </Binding.Converter>
                    </Binding>
                </DataTrigger.Binding>
                <Setter Property="IsEnabled" Value="False"></Setter>
                <Setter Property="Padding" Value="0"></Setter>
                <Setter Property="Margin" Value="0"></Setter>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style TargetType="{x:Type ComboBox}" x:Key="fontFamilyComboBoxStyle" BasedOn="{StaticResource {x:Static UI1:Styles.RibbonComboBoxStyleKey}}">
        <Style.Resources>
            <DataTemplate DataType="{x:Type UI:FontFamilyGroup}">
                <Border BorderThickness="0 0 0 1" BorderBrush="#FFC5C5C5">
                    <TextBlock Text="{Binding Name}" Background="#FFDDE7EE" FontWeight="Bold"/>
                </Border>
            </DataTemplate>
            <DataTemplate DataType="{x:Type FontFamily}">
                <!--    <TextBlock Text ="{Binding Source}" Loaded="OnFontTextBlockLoaded" FontSize="14"/> -->
                <TextBlock Text ="{Binding Source}" FontSize="14" FontFamily="{Binding}" Width="220"/>
            </DataTemplate>

        </Style.Resources>
        <Setter Property="ItemContainerStyle" Value="{StaticResource cbis}"></Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel/>
                </ItemsPanelTemplate>

            </Setter.Value>
        </Setter>
        <Setter Property="Focusable" Value="False" />
        <Setter Property="Width" Value="80"/>
        <Setter Property="Foreground" Value="Black"/>
    </Style>


</ResourceDictionary>